package demo1;

public class Student1 {
    //属性
    String name;
    int age;

    //定义构造函数给属性初始化值
    public Student1(String name, int age){
        super();
        this.name = name;
        this.age = age;
    }

    //给属性生成get和set方法
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    //生成toString()函数
    @Override
    public String toString() {
        return "Student [name=" + name + ", age=" + age + "]";
    }
}
